<?php
error_reporting(E_ALL || ~E_NOTICE);
$path = dirname($_SERVER['SCRIPT_FILENAME']);
define('ROOT_PATH',substr($path,0,strripos($path,'/')+1));
define('DEBUG', 1);
define('APP_NAME', 'DB');
define('APP_PATH', ROOT_PATH.'home/');
define('PUBLIC_PATH', ROOT_PATH.'public/');


$route = $_GET['m'];
// $action = $_GET('a');

$route = preg_match("/^\w+$/", $route) ? $route : 'home';

$filename = APP_PATH.'view/'.$route.'.html';

if(is_file($filename) )
{
    $inc_main = APP_PATH.'view/'.$route.'.html';
    include APP_PATH.'view/layout.html'; 

}else{

    exit("Error"); 
}



